<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/2/24
 * Time: 14:49
 */
namespace App\Task;
use App\Service\SettleTradeOrderThawBondService;
use App\Utils\CustomUtils;
use Hyperf\Crontab\Annotation\Crontab;
use Hyperf\Di\Annotation\Inject;

/**
 * @Crontab(name="TradeOrderBondThawTask", rule="0 0/2 * * *", callback="execute", memo="保证金冻结，每晚凌晨要启动")
 */
class TradeOrderBondThawTask
{

    /**
     * @Inject()
     * @var SettleTradeOrderThawBondService
     */
    private $SettleTradeOrderBondThawService;

    public function execute()
    {
        $startTime = time();
        CustomUtils::xzxDebug("交易保证金解冻任务执行，当前时间: " . date('Y-m-d H:i:s', $startTime));

        $this->SettleTradeOrderBondThawService->statAndPush();

        $endTime = time();
        CustomUtils::xzxDebug("交易保证金解冻任务执行完成，执行耗时: " . ($endTime - $startTime));
    }

}